package com.student.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Payment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Payment", schema = "dbo", catalog = "StudentManager")
public class Payment implements java.io.Serializable {

	// Fields

	private Long paymentId;
	private Student student;
	private Double fee;
	private Double unpaid;
	private Timestamp paymentDate;

	// Constructors

	/** default constructor */
	public Payment() {
	}

	/** minimal constructor */
	public Payment(Long paymentId, Double fee, Double unpaid,
			Timestamp paymentDate) {
		this.paymentId = paymentId;
		this.fee = fee;
		this.unpaid = unpaid;
		this.paymentDate = paymentDate;
	}

	/** full constructor */
	public Payment(Long paymentId, Student student, Double fee, Double unpaid,
			Timestamp paymentDate) {
		this.paymentId = paymentId;
		this.student = student;
		this.fee = fee;
		this.unpaid = unpaid;
		this.paymentDate = paymentDate;
	}

	// Property accessors
	@Id
	@Column(name = "Payment_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getPaymentId() {
		return this.paymentId;
	}

	public void setPaymentId(Long paymentId) {
		this.paymentId = paymentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Student_id")
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@Column(name = "Fee", nullable = false, scale = 4)
	public Double getFee() {
		return this.fee;
	}

	public void setFee(Double fee) {
		this.fee = fee;
	}

	@Column(name = "Unpaid", nullable = false, scale = 4)
	public Double getUnpaid() {
		return this.unpaid;
	}

	public void setUnpaid(Double unpaid) {
		this.unpaid = unpaid;
	}

	@Column(name = "Payment_Date", nullable = false, length = 23)
	public Timestamp getPaymentDate() {
		return this.paymentDate;
	}

	public void setPaymentDate(Timestamp paymentDate) {
		this.paymentDate = paymentDate;
	}

}